package kr.saeildamil.androidstudy_second.draw;

import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BlurMaskFilter;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.View;

public class Translate extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(new MyView(this));
	}
	
	public class MyView extends View {
		Paint paint;
		Bitmap cup;
		BlurMaskFilter blur;

		public MyView(Context context) {
			super(context);

		}

		@Override
		protected void onDraw(Canvas canvas) {
			super.onDraw(canvas);
			paint = new Paint();
			paint.setAntiAlias(true);

			paint.setColor(Color.YELLOW);
			canvas.drawRect(10, 10, 100, 100, paint);
			
			paint.setColor(Color.GREEN);
			canvas.save();
			canvas.translate(200, 0);
			canvas.drawRect(10, 10, 100, 100, paint);
			
			paint.setColor(Color.BLUE);
			canvas.restore();
			canvas.translate(200, 200);
			canvas.drawRect(10, 10, 100, 100, paint);
			
			/*paint.setColor(Color.GREEN);
			canvas.translate(200, 0);
			canvas.drawRect(10, 10, 100, 100, paint);

			paint.setColor(Color.BLUE);
			canvas.translate(0, 200);
			canvas.drawRect(10, 10, 100, 100, paint);*/

		}
	}
}
